<?php 

include '../function.php';

$src = "./images/bg.jpg";

function CheckImages($src)
{
	$tmp = array('jpg','png','gif','bmp');

	$arr = explode('.', $src);

	$last = $arr[count($arr)-1];

	if(in_array($last, $tmp)){
		echo '是图片';
	}else{
		echo '不是图片';
	}


}

CheckImages($src);





 ?>